<!DOCTYPE html>
<html lang='zh-CN'>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-touch-fullscreen" content="yes">
	<link rel="profile" href="http://gmpg.org/xfn/11">

	<link rel="stylesheet" href="/datas/themes/fangtang/assets/css/global.css">
	<?php wp_head(); ?>
</head>

<body>
<div id="page" class="site">
	<header class="site-header">
		<div class="inner cf">
			<h1 class="site-logo"><a href="/">方糖</a></h1>
			<aside class="accessNav">
				<a href="/new-post" class="btn btn-primary">投稿</a>
				<?php
				if (is_user_logged_in()):
					$current_user = wp_get_current_user();
				?>
					<span><?php echo $current_user->display_name; ?>，欢迎您</span>
				<?php else : ?>
					<a href='/login'>登录</a>
					<i class="I">|</i>
					<a href='/register'>注册</a>
				<?php endif; ?>
			</aside>
			<?php if ( has_nav_menu( 'main' ) ) : ?>
				<nav class="cf" role="navigation" aria-label="主导航">
					<?php
						wp_nav_menu( array(
							'theme_location' => 'main',
							'container' => '',
							'menu_class' => 'mainNavi cf',
						 ) );
					?>
				</nav>
			<?php endif; ?>
		</div>
	</header>
	<?php if ( is_front_page() ) : ?>
		<div id="swiper_banner" class="banners swiper-container">
		    <ul id="bannerSlider" class="swiper-wrapper">
		    <?php
		    $banner_set = get_option('banners');
		    if ( $banner_set ) :
		        $banners = explode("\n", get_option('banners'));
		        foreach ($banners as $key => $banner) {
		            $attr = explode('--', $banner);
		            echo '<li class="swiper-slide slide'. ( $key == 0 ? ' first' : '' ) .'" style="background-color: '. $attr[0] .';background-image:url('. $attr[1] .')">';
		            echo isset($attr[2]) ? ' <a href="'. $attr[2] .'"></a>' : '';
		            echo '</li>';
		        }
		    endif;
		    ?>
		    </ul>
		    <div class="swiper-pagination bannerPagi"></div>
		    <div class="swiper-button-next fi fi-arrow-right"></div>
		    <div class="swiper-button-prev fi fi-arrow-left"></div>
		</div>
	<?php endif; ?>
	<div id="content" class="site-content">
